﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Controls_YY : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Page_DataBinding(object sender, EventArgs e)
    {
        ddlYY.DataBind();
    }

    public int YearPlus
    {
        get
        {
            if (ViewState["YearPlus"] == null)
            {
                return 0;
            }

            return (int)ViewState["YearPlus"];
        }
        set
        {
            ViewState["YearPlus"] = value;
        }
    }

    public bool Optional
    {
        get
        {
            if (ViewState["Optional"] == null)
            {
                return false;
            }

            return (bool)ViewState["Optional"];
        }
        set
        {
            ViewState["Optional"] = value;
        }
    }

    public string Text
    {
        get
        {
            return ddlYY.Text;
        }
    }

    public DateTime Value
    {
        get
        {
            return DateTime.Parse(ddlYY.Text + @"/1/1");
            //return DateTime.ParseExact(ddlYYMM.Text, "yyyy/MM/1", MyObj.CurrentCulture);
        }
    }
}